//
// Created by Administrator on 2021/9/29.
//

#ifndef HELLOOPENGL_STRING_H
#define HELLOOPENGL_STRING_H
#include <string>
#include <cstring>
#include <sstream>

class String final{
private:
    std::string self;
public:
    String();
    String(const std::string& s);
    String& operator = (const char* s);
    void operator += (const char* s);
    void operator += (const std::string& s);
    void operator += (const String& s);
    const char* c_str();

    /**
     * float转string
     * @param f 数值
     * @return string
     */
    static String float2string(float f) {
        std::ostringstream bf;
        bf << f;
        return String(bf.str());
    }
};


#endif //HELLOOPENGL_STRING_H
